package com.t18;

import java.io.*;

/**
 * Created by xuyiwei on 2018/9/2.
 */
public class BasicFileOutput {
    static String fileOut  ="/Users/xuyiwei/Documents/javaBase/jdk/src/com/t18/BasicFileOutputCopy.java";
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new StringReader(
                BufferedInputFile.read(
                        "/Users/xuyiwei/Documents/javaBase/jdk/src/com/t18/BasicFileOutput.java")));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(fileOut)));
//        PrintWriter pw = new PrintWriter(fileOut);

        int lineCount = 1;
        String s ;
        while((s=in.readLine())!=null){
            pw.println(lineCount+":"+s);
            lineCount++;
        }
        pw.close();
        System.out.println(BufferedInputFile.read(fileOut));
    }

}
